﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using GPM.QuickQuote.Logging;
using System.Diagnostics;
using IMTApp;
using System.IO;




namespace IMTTests
{
    [TestClass]
    public class UnitTest1
    {

        

        [TestMethod]
        public void Output_To_Log()
        {
              GpmLogger logger = new GpmLogger();
              logger.LogInfo("Test");                       
        }


        [TestMethod]
        public void Send_SMTP_via_Log4Net()
        {
            GpmLogger logger = new GpmLogger();
            logger.LogFatal("E-mail Test - ERROR");

            logger.LogInfo("E-mail Test - INFO");

        }

   

        [TestMethod]
        public void Query_Endorsement_XML()
        {
            GlobalData.rootPath = @"C:\TSMSG";

            QueryEndorsementMSG QEMsg = new QueryEndorsementMSG();

            QEMsg.buildXMLString("8660");


        }
        
        [TestMethod]
        public void Create_A_Message()
        {

            GlobalData.rootPath = @"C:\TSMSG";

            string[,] UnderwriterArray = new string[1, 13];
            UnderwriterArray[0, 0] = "Lloyd's Syndicate 1919";
            UnderwriterArray[0, 1] = "John Smith";
            UnderwriterArray[0, 2] = "John.Smith@carrier1.com";
            UnderwriterArray[0, 3] = "duns"; // agency attribute
            UnderwriterArray[0, 4] = "111111121";
            UnderwriterArray[0, 5] = "lloyds";// agency attribute
            UnderwriterArray[0, 6] = "8001";
            UnderwriterArray[0, 7] = "123456789";
            UnderwriterArray[0, 8] = "1";
            UnderwriterArray[0, 9] = "leader";
            UnderwriterArray[0, 10] = "acord";
            UnderwriterArray[0, 11] = "no";
            UnderwriterArray[0, 12] = "1";
            /*
            UnderwriterArray[1, 0] = "Lloyd's Syndicate 2007";
            UnderwriterArray[1, 1] = "John Smith";
            UnderwriterArray[1, 2] = "John.Smith@carrier2.com";
            UnderwriterArray[1, 3] = "duns"; // agency attribute
            UnderwriterArray[1, 4] = "222222222";
            UnderwriterArray[1, 5] = "lloyds";// agency attribute
            UnderwriterArray[1, 6] = "8002";
            UnderwriterArray[1, 7] = "123456789";
            UnderwriterArray[1, 8] = "2";
            UnderwriterArray[1, 9] = "otheragreementparty";
            UnderwriterArray[1, 10] = "email";
            UnderwriterArray[1, 11] = "no";
            UnderwriterArray[1, 12] = "2";
            */

            string[,] DocumentArray = new string[1, 15];
            DocumentArray[0, 0] = "66611:2";
            DocumentArray[0, 1] = "Example.doc";
            DocumentArray[0, 2] = "lm_bureau_endorsement";
            DocumentArray[0, 3] = "Long Description of File";
            DocumentArray[0, 4] = @"C:\TSMSG\Example.docx";

            SubmitEndorsementMsg foo = new SubmitEndorsementMsg(
                        "GPM",
                        "VSYMIZe9dUQWrmx5M9lKKm24VaCojSv2IJP28mnLErmulzxIf97En7BJ/fXXIvXDylEzfRiVcjyXrpHj7Wdm010ZZU0YMLCb",
                        "SubmitEndorsement",
                        "Trisys Test",
                        "B8998",
                        "Elliott Perry",
                        "0771 540 6894",
                        "atest@bob.com",
                        "EP Sys",
                        "B8998E080602",
                        "Test Endorsement 2 - to TEST Env",
                        "direct",
                        "cargo_unspecified",
                        "lineslip",
                        "End 001",
                        "Simple Test",
                        "gua_a",
                        "1",
                        UnderwriterArray,
                        DocumentArray
                        );
            
        }
    }
}
